package com.cdyx.outsideprescription.task;

import com.cdyx.outsideprescription.service.ITbRecipeinfoService;
import com.cdyx.outsideprescription.vo.DiagnoseVo;
import com.cdyx.outsideprescription.vo.RecipeDetailsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class AsyncTask {
    @Qualifier("tbRecipeinfoServiceImpl")
    @Autowired
    private ITbRecipeinfoService recipeinfoService;
    @Async
    public void  saveDiagnose(String visitNo, List<DiagnoseVo> diagnoses){
       // addprecriptionService.addprecriptionInfo(visitNo,diagnoses, data);
    }

    @Async
    public void saveRecipeDetails(String visitNo, String recipeKinds, String expiryDate, String openDocAdvice, List<RecipeDetailsVo> recipeDetailsVos){
         recipeinfoService.saveRecipe(visitNo,recipeKinds,expiryDate,openDocAdvice,recipeDetailsVos);
    }
}
